package com.neusoft.neu24g3.myhis1.controller;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Enumeration;

/**
 * MemberLoginServlet 成员登录
 *
 * @author Administrator
 * @version 2024/05/27 09:38
 * 条件：
 * 1、必须实现Servlet接口
 * 2、必须在Servlet容器中注册
 **/
public class MemberLoginServlet extends HttpServlet {
    private  String name ;

    @Override
    public void init() throws ServletException {
        this.name =   getInitParameter("xyz");
    }

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        System.out.println("MemberLoginServlet.doGet");
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
//        1、 响应请求
//        2、解决乱问题
//        req.setCharacterEncoding("utf8");
//        resp.setCharacterEncoding("utf8");
//        3、提取表单数据
//        Enumeration<String> enumeration =   req.getParameterNames();  //  form  key
//        while (enumeration.hasMoreElements()){
//            String key =  enumeration.nextElement();
//            String logid = req.getParameter(key);
//        }
//        String logid = req.getParameter("logid");
//        String logpwd = req.getParameter("logpwd");
////        4、封装表单数据为Bean
//
//        Member member =new Member();
//        member.setLogid(logid)

//        5、调用service完成业务逻辑功能
//        6、根据业务的返回值，形成响应
    }
}